from picshell.engine.core.PicEngine import PicEngine
from picshell.engine.core.State import State
    
class StateMonitor :
    def __init__(self):
        self.address = 6 # PORTB
    def execute(self,value): 
        print value

# Code execution start here
#
print "Start"    
engine = PicEngine.newInstance("16f628a",".\\test_hex_files\\picshell_portb_demo_16f.hex")
engine.state.setMonitors([StateMonitor()]) # 
engine.runTillAddress(engine.lastAddress)
print "End"